<!DOCTYPE html>
<html>
<head>
	<title>快件e栈服务平台</title>
	<meta charset="utf-8">
	<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport" />
	<link href="css/normalize.css" rel="stylesheet" type="text/css" />
	<link href="css/main.css" rel="stylesheet" type="text/css" />
	<script src="js/jquery.min.js" type="text/javascript"></script>
	<script src="js/notice.js" type="text/javascript"></script>
	<script src="js/common.js" type="text/javascript"></script>
</head>
<body>
	<div class="content">
		<div class="top autoH">
			<div class="logo autoH">
				<img src="images/logo.png" width="100%">
			</div>
		</div>
		<div class="middle">
			<form id="theForm">
				<div class="forminput">
					<input id="expressNum" name="expressNum" placeholder="请输入快递单号..." type="text">
					<input id="PageContext" type="hidden" value="${pageContext.request.contextPath}" />
					<div class="submBtn" id="submBtn"></div>
				</div>
			</form>
		</div>
		<div class="funContdiv">
			<div class="funCont">
				<div class="userFun">
					<p class="funIcon userFunColor1"></p>
					<p class="funTxt">个人中心</p>
				</div>
				<div class="userFun">
					<p class="funIcon userFunColor2"></p>
					<p class="funTxt">懒人排行</p>
				</div>
				<div class="userFun">
					<p class="funIcon userFunColor3"></p>
					<p class="funTxt">取货二维码</p>
				</div>
				<div class="userFun">
					<p class="funIcon userFunColor4"></p>
					<p class="funTxt">我的快件</p>
				</div>
					<div class="userFun" id="userFun">
						<p class="funIcon userFunColor5"></p>
						<p class="funTxt">快递助手</p>
					</div>
					<div class="userFun">
						<p class="funIcon userFunColor6"></p>
						<p class="funTxt">退出登录</p>
					</div>
			</div>
		</div>
	
		<div class="footer">
			<p class="copytxt">&copy;新职课版权所有</p>
		</div>
	</div>
	<script src="js/layer/layer.js"></script>
	<script type="text/javascript">
	var isUser;
	$(function(){
		$.getJSON("/wx/userInfo.do",null,function(data){
			if(data.status == 0){
				isUser = true;
				$("#userFun").hide();
			}else{
				isUser = false;
			}
			layer.msg("欢迎你: "+data.result);
		});
	});

	$(function(){
		var pageContextVal = $("#PageContext").val();
		$(".userFun").click(function(){
			var clickNum = $(this).index();
			switch(clickNum){
				//个人中心
				case(0): window.location.href= "/wx/views/wxUserhome.html";break;
				case(1): window.location.href= "/wx/views/lazyboard.html";break;
				case(2): window.location.href= "/wx/createQRCode.do?type=user"; break;
				case(3): window.location.href= "/wx/views/expressList.html"; break;
				case(4): window.location.href= "/wx/views/expressAssist.html"; break;
				case(5):
					// 告知退出
						$.getJSON("/wx/logout.do",null,function(data){
							window.location.href = "login.html";
						});
					window.location.href= "login.html";
					break;
			}
		});

		var initFunc = function(){
			var windowH = $(document).height();
			var windowW = $(document).width();

			$(".content").css({"height": windowH+"px"});

			var contentW = $(".content").width();
			var contentH = $(".content").height();

			var contH = windowH / 3;
			$(".autoH").css({"height": contH+"px"});

			// userFunH  content
			var middleH = $(".middle").height() + 40;
			var userFunH = contentH - contH - middleH - 30 -20; //footer,userfun(margin)
			$(".funContdiv").css({"height":userFunH+"px"});

			var funIconH = $(".funIcon").width(); 
			$(".funIcon").css({"height": funIconH+"px","line-height": funIconH+"px","border-radius": funIconH/2 +"px","font-size":funIconH/2 +"px"});

		};

		initFunc();

		$(window).resize(function(){
			initFunc();
		});

		// input focus
		$(".middle .forminput input").focus(function(){
			$(".middle .forminput").css({"border":"1px solid rgba(31,114,255,.75)","box-shadow":"0 0 8px rgba(31,114,255,.5)"});
		});

		// input blur
		$(".middle .forminput input").blur(function(){
			$(".middle .forminput").css({"border":"1px solid #333333","box-shadow":"none"});
		});
	});
	</script>
	<script>
		$(function (){
			$("#submBtn").click(function(){
				var expressNum = $("#expressNum").val();
				$.getJSON("/wx/findExpressByNumber.do",{expressNum:expressNum},function(rs){
					if (rs.status == 0){
						window.location.href= "/wx/views/expressList.html";
					}else{
						layer.msg(rs.result);
					}
				});
			});


		});
	</script>
</body>
</html>